package com.zdxc.controller;


import com.zdxc.entities.Equipment;
import com.zdxc.service.AddressService;
import com.zdxc.service.EquipmentService;
import common.bean.Paging;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="/equip/*")
public class EquipmentController {
    @Autowired
    private EquipmentService equipmentService;

    @RequestMapping("/getid")
    @ResponseBody
    public Equipment getUser(@RequestParam("id") String equipId){
       return  equipmentService.findByKey(equipId);
    }

    /**
     * 分页返回
     * @param equipmentInfo
     * @param paging
     * @return
     */
    @RequestMapping("/getcondition")
    @ResponseBody
    public Paging getusers(Equipment equipmentInfo, Paging paging){
        Paging resultPage =equipmentService.findByCondition(equipmentInfo,paging);
        return  resultPage;
    }

    @RequestMapping(value="/list")
    public String list(){
        return "equip/list";
    }



}
